package animator.phantom.renderer.plugin;

import animator.phantom.plugin.*;
import animator.phantom.renderer.param.*;
import animator.phantom.paramedit.*;
import giotto2D.filters.color.SmoothThreshold;
import java.awt.image.*;
import java.awt.*;
import java.util.*;

public class SmoothThresholdPlugin extends PhantomPlugin
{

	public IntegerParam toneLimit = new IntegerParam( 128 );

	public SmoothThresholdPlugin()
	{
		initPlugin( FILTER );
	}

	public void buildDataModel()
	{
		setName( "SmoothThreshold" );


		registerParameter( toneLimit );

	}

	public void buildEditPanel()
	{
		IntegerNumberEditor limitEditor = new IntegerNumberEditor( "Threshold", toneLimit);


		addEditor( limitEditor );
	}

	public void doImageRendering( int frame )
	{
		BufferedImage img  = getFlowImage();
		SmoothThreshold f = new SmoothThreshold();
		f.filter( img );

		sendFilteredImage( img, frame );
	}

}//end class
